package info.sswap.ontologies.util;

import java.net.URI;

public class URIUtils {

	public static String getNamespace(URI term) {
		String uriString = term.toString();
		int index = Math.max(uriString.lastIndexOf('/'), uriString.lastIndexOf('#'));
		
		return index >= 0 ? uriString.substring(0,  index) : term.toString();
	}
}
